{% extends 'myadmin/base.html' %}
{% block myadmin_course_active %}
    active
{% endblock %}
{% block myadmin %}
    {% load static %}
    <div class="">
        <h3 style="margin-top: 30px">&emsp;&emsp;管理课程</h3>

        <table class="table table-striped table-hover text-center  "
               style="vertical-align: middle;text-align: center;">
            <thead>
            <tr>
                <th scope="col">序号</th>
                <th scope="col">图片</th>
                <th scope="col">课程名</th>
                <th scope="col">课程类</th>
                <th scope="col">审核状态</th>
                <th scope="col">操作</th>
            </tr>
            </thead>
            <tbody>
            {% for i in cource %}



                <tr>
                    <td>{{ forloop.counter }}</td>
                    <td><img src="/static/media/{{ i.photo }}" height="60px" alt=""></td>
                    <td>{{ i.name }}</td>
                    <td>{% if i.type == 1 %}
                        工学
                    {% endif %} </td>
                    {% if i.audit == 1 %}
                        <td style="color: #e3c00f">
                            待审核
                        </td>
                    {% elif i.audit == 2 %}
                        <td style="color: rgba(16,124,34,0.87)">
                            审核成功
                        </td>
                    {% elif i.audit == 3 %}
                        <td style="color: rgba(239,9,43,0.87)">
                            审核失败！
                        </td>
                    {% endif %}

                    <td>

                        <a onclick="if(confirm('确定删除吗？')==false)return false;location.href=('{% url 'myadmin_cource_del' i.id %}')"
                           class="btn btn-danger glyphicon glyphicon-remove btn-sm">删除
                        </a>

                    </td>
                </tr>
            {% endfor %}


            </tbody>
        </table>
        <hr>


    </div>
{% endblock %}